- financial_year = FinancialYear.find_by(id: params[:current_financial_year])
- financial_year ||= FinancialYear.current
- if financial_year
  - main_financial_year_selector(financial_year)
  - params[:period] = financial_year.started_on.to_s << '_' << financial_year.stopped_on.to_s
  - params[:current_financial_year] ||= financial_year.id


- if params[:period]
  = main_toolbar do |t|
    = t.export :general_ledger,
               item_label: :export_as_pdf.tl,
               key: Printers::GeneralLedgerPrinter.build_key(financial_year: financial_year,
                                                             states: params[:states],
                                                             lettering_state: params[:lettering_state],
                                                             account_number: params[:account_number],
                                                             ledger: params[:ledger]) do |menu|
      - export_params = params.slice(:current_financial_year, :states, :account_number, :centralize, :lettering_state, :ledger, :level_1, :level_2, :level_3, :level_4, :level_5, :level_6, :level_7, :level_8, :level_9, :level_10)
      - menu.item :export_as_ods.tl, params: export_params.merge(format: :ods)
      - menu.item :export_as_csv.tl, params: export_params.merge(format: :csv)
      - menu.item :export_as_xcsv.tl, params: export_params.merge(format: :xcsv)

= kujaku actions: false do |k|
  - k.helper :ledger_crit
  - k.hidden :current_financial_year

:ruby
  list = if params[:ledger] == 'general_ledger'
           :centralized_ledger_accounts
         else
           :subledger_accounts
         end

= main_list(list)
